<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
		<link rel="stylesheet" type="text/css" href="css/form.css"/>
	</head>
	<body>
		<div class="main">
			<h3>用户登录</h3>
			<div class="login-form">
				<p>
					<input id="userName" placeholder="请输入账号" class="username input">
				</p>
				<p>
					<input id="password" placeholder="请输入密码" class="password input">
				</p>
				<p>
					<input id="login" type='button' value="点击登录" class="btn">
				</p>
				<p>
					<input id="loginAdd" type='button' value="还没账号?点击注册" class="btn">
				</p>
			</div>
			
		</div>

	<script src="/qrcode/jquery2.1.4.js"></script>
	<script src="/layer/layer.js"></script>
	<script>
		$(function () {
			$("#login").click(function () {
				var userName = $("#userName").val();
				var password = $("#password").val();
				var windowId = layer.load();
				$.post("/vx/login.do",{userName:userName,password:password},function (data) {
					layer.close(windowId);
					layer.msg(data.result);
					if(data.status == 0){
						//管理员
						window.location.href = "index.html"
					}else if(data.status == 1){
						//用户
						window.location.href = "index.html"
					}
				},"JSON");
			});


			$("#loginAdd").click(function () {
				location.href = "reg.html"
			})
		});
	</script>
	</body>
</html>
